package com.qingxin.cms.entity;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.format.annotation.DateTimeFormat;

import com.qingxin.park.entity.FarmPark;

/**
 * 巡查项目表
 */
@Entity
@Table(name = "inspection_item")
public class InspectionItem extends com.qingxin.sys.entity.BaseEntity implements
		java.io.Serializable {
	private static final long serialVersionUID = 5088999027315337213L;
	// Fields

	private String itemId;//巡查项目ID
	private InspectionTask inspectionTask;//巡查任务
	private FarmPark farmPark;//园区ID
	private String itemName;//项目名称
	private String remark;//备注
	private String result;//结果
	private String createBy;
	private Date createTime;
	private String updateBy;
	private Date updateTime;
	private String finishBy;//完成者
	private String keyjob;//关键作业：0否1是
	@DateTimeFormat(pattern="yyyy-MM-dd")
	private Date finishTime;//完成时间

	// Constructors

	/** default constructor */
	public InspectionItem() {
	
		
	}
	
	
	public InspectionItem(String itemId, String itemName, String createBy,
			Date createTime, String updateBy, Date updateTime, String finishBy,
			Date finishTime) {
		super();
		this.itemId = itemId;
		this.itemName = itemName;
		this.createBy = createBy;
		this.createTime = createTime;
		this.updateBy = updateBy;
		this.updateTime = updateTime;
		this.finishBy = finishBy;
		this.finishTime = finishTime;
	}





	/** full constructor */
	public InspectionItem(String itemId, InspectionTask inspectionTask,
			FarmPark farmPark, String itemName, String remark, String result,
			String createBy, Date createTime, String updateBy, Date updateTime,
			String finishBy, Date finishTime) {
		super();
		this.itemId = itemId;
		this.inspectionTask = inspectionTask;
		this.farmPark = farmPark;
		this.itemName = itemName;
		this.remark = remark;
		this.result = result;
		this.createBy = createBy;
		this.createTime = createTime;
		this.updateBy = updateBy;
		this.updateTime = updateTime;
		this.finishBy = finishBy;
		this.finishTime = finishTime;
	}


	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "item_id", unique = true, nullable = false, length = 32)
	public String getItemId() {
		return this.itemId;
	}

	public void setItemId(String itemId) {
		this.itemId = itemId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "task_id")
	public InspectionTask getInspectionTask() {
		return this.inspectionTask;
	}

	public void setInspectionTask(InspectionTask inspectionTask) {
		this.inspectionTask = inspectionTask;
	}

	@Column(name = "item_name", length = 50)
	public String getItemName() {
		return this.itemName;
	}

	public void setItemName(String itemName) {
		this.itemName = itemName;
	}
	
	@OneToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "parkid")
	public FarmPark getFarmPark() {
		return farmPark;
	}

	public void setFarmPark(FarmPark farmPark) {
		this.farmPark = farmPark;
	}
	@Column(name = "result", length = 2000)
	public String getResult() {
		return result;
	}

	public void setResult(String result) {
		this.result = result;
	}

	@Column(name = "remark", length = 2000)
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "create_by", length = 32)
	public String getCreateBy() {
		return this.createBy;
	}

	public void setCreateBy(String createBy) {
		this.createBy = createBy;
	}

	@Column(name = "create_time", length = 23)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Column(name = "update_by", length = 32)
	public String getUpdateBy() {
		return this.updateBy;
	}

	public void setUpdateBy(String updateBy) {
		this.updateBy = updateBy;
	}

	@Column(name = "update_time", length = 23)
	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
	@Column(name = "finish_by", length = 32)
	public String getFinishBy() {
		return this.finishBy;
	}

	public void setFinishBy(String finishBy) {
		this.finishBy = finishBy;
	}

	@Column(name = "finish_time", length = 23)
	public Date getFinishTime() {
		return this.finishTime;
	}

	public void setFinishTime(Date finishTime) {
		this.finishTime = finishTime;
	}


}